package chapter2.sorting;

/**
 * Created by wsy on 2017/12/2 0002.
 */
public class A2_1SelectionSort {
    public static void sort(Integer[] a){
        int N = a.length;
        for(int i = 0; i< N; i++){
            int min = i;
            for(int j = i; j < N; j++){
                if( C2_1_1Example.less(a[j],a[min]))
                    min = j;
            }
            C2_1_1Example.exch(a, min, i);
        }
    }
}
